var express = require('express')
var { graphqlHTTP } = require('express-graphql')
var { buildSchema } = require('graphql')

var schema = buildSchema(`
  type Query {
    hello: String,
    k:Int
  }
`)

var root = { hello: () => 'Hello world!', k: () => 1 }

var app = express()
app.use(
  '/graphql',
  graphqlHTTP({
    schema: schema,
    rootValue: root,
    graphiql: true,
  })
)
app.listen(4000, () => console.log('Now browse to localhost:4000/graphql'))
